# requires --extra-vars="target='host1;host2;group etc' yumcommand=update'"

- name: update all run rkhunter if installed
  hosts: $target
  user: root

  tasks:
  - name: expire-caches
    action: command yum clean expire-cache
    
  - name: yum -y ${yumcommand}
    action: command yum -y ${yumcommand}
    async: 7200
    poll: 15

  - name: check for rkhunter
    action: command /usr/bin/test -f /usr/bin/rkhunter
    register: rkhunter
    ignore_errors: true
  
  - name: run rkhunter --propupd
    action: command /usr/bin/rkhunter --propupd
    when: rkhunter|success





